<template>
	<view class="entry-index">
	</view>
</template>

<script>
	import {
		login
	} from '@/api/login.js'
	export default {
		data() {
			return {}
		},
		created() {
			this.pickPage()
		},
		methods: {
			pickPage() {
				let _this = this;
				if (_this.$store.state.vuex_zidong) {
					uni.showLoading({
						title: '正在加载'
					});
					login({
						account: _this.$store.state.vuex_account,
						password: _this.$store.state.vuex_pass
					}).then(res => {
						uni.hideLoading();
						if (res.success) {
							_this.$u.vuex('vuex_info', res.data);
							uni.reLaunch({
								url: '/pages/home/index'
							})
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none'
							});
							uni.reLaunch({
								url: '/pages/login/login'
							})
						}
					})
				} else {
					uni.reLaunch({
						url: '/pages/login/login'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.entry-index {
		.privacy-box {
			font-size: 28rpx;
			padding: 40rpx;

			.nav-box {
				color: $u-primary;
				display: inline-block;
			}
		}
	}
</style>